﻿using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using MyStyle.Model;

namespace MyStyle.Repositry
{
    public class CustomItemMap : IEntityTypeConfiguration<CustomItem>
    {
        public void Configure(EntityTypeBuilder<CustomItem> builder)
        {
            builder.ToTable("customer_item");
            builder.Property(x => x.Id).ValueGeneratedOnAdd().HasColumnName("id").HasColumnType("INT");
            builder.Property(x => x.CustomerId).HasColumnName("cid").HasColumnType("INT");
            builder.Property(x => x.CustomItemName).HasColumnName("name") .HasColumnType("NVARCHAR(100)");
            //builder.Property(x => x.PaymentType).HasColumnName("payment_type").HasColumnType("NVARCHAR(50)") .IsRequired();
            //builder.Property(x => x.CreateDate) .HasColumnName("created_date") .HasColumnType("datetime");
            //builder.Property(x => x.ModifyDate) .HasColumnName("modified_date").HasColumnType("datetime");
            //builder.Property(x => x.IsActive).HasColumnName("is_active") .HasColumnType("bit");

            // builder.HasOne(x => x.Customer).WithMany(x => x.CustomItem).HasForeignKey(x => x.CustomerId);
        }
    }
}
